#include <QLabel>
#include <QtPlugin>
#include <QWidget>
#include <QImage>
#include <QPixmap>
#include <QLabel>
#include <QVBoxLayout>
#include <QMessageBox>
#include <QCheckBox>
#include <QPushButton>
#include <QFileDialog>
#include <QString>
#include <QScrollArea>

#include <opencv/cv.h>
#include <opencv/highgui.h>

#include "QCVModuleInterface.h"
#include "QCVModuleHandlerInterface.h"

#ifndef MODULEDISPLAYER_H
#define MODULEDISPLAYER_H

/**
@class ModuleDisplayer
@brief Module d'affichage image + points d'interêts
*/
class ModuleDisplayer:public QObject,QCVModuleInterface
{
  Q_OBJECT
	Q_INTERFACES(QCVModuleInterface)
	
	public:
		void init(QCVModuleHandlerInterface * parent);
		void free();

		cv::Mat & process();
		void setInput(int n,const cv::Mat & m);

		QWidget* widget();
		QString getName();
		int nbInputs();
		QString help(int id);

		QString getParams();
		bool setParams(QString params);
	
		QCVModuleInterface * clone();

	public slots:
		void s_save();
		
  private:
		QScrollArea * scroll;
    QWidget * win;
    QVBoxLayout * layout;
    QLabel * view;
    QCheckBox * display_data;
		QCheckBox * labelised;
		QCheckBox * display_boxes;
		
    cv::Mat frame;
    cv::Mat_<int> data;
		cv::Mat_<int> boxes;

		QPushButton * pb_save;
    QCVModuleHandlerInterface * parent;
		
		std::vector<cv::Scalar> colors;

};

#endif
